import requests from './request'
import mock from './mockAjax'

export const reqCategoryList = () => requests({ url: '/api/product/getBaseCategoryList', method: 'get' })
export const bannerList = () => mock.get('/banner')
export const reqfloorList = () => mock.get('/floor')
export const reqGetSearchInfo = (params) => requests({ url: '/api/list', method: 'post', data: params })
export const reqGetGoodInfo = (skuId) => requests({ url: `/api/item/${skuId}`, method: 'get' })
export const reqAddShopCart = (skuId, skuNum) => requests({ url: `/api/cart/addToCart/${skuId}/${skuNum}`, method: 'post' })
export const reqGetCartList = () => requests({ url: '/api/cart/cartList', method: 'get' })
export const deleteGood = (skuId) => requests({ url: `/api/cart/deleteCart/${skuId}`, method: 'delete' })
export const reqCheckCart = (skuID, isChecked) => requests({ url: `/api/cart/checkCart/${skuID}/${isChecked}`, method: 'get' })
export const reqGetCode = (phone) => requests({ url: `/api/user/passport/sendCode/${phone}`, method: 'get' })
export const reqRegister = (data) => requests({ url: '/api/user/passport/register', data, method: 'post' })
export const reqUserLogin = (data) => requests({ url: '/api/user/passport/login', method: 'post', data })
export const reqGetUSerInfo = () => requests({ url: 'api/user/passport/auth/getUserInfo', method: 'get' })
export const reqLogOut = () => requests({ url: '/api/user/passport/logout', method: 'get' })
export const reqGetAddress = () => requests({ url: '/api/user/userAddress/auth/findUserAddressList', method: 'get' })
export const reqGetTradeList = () => requests({ url: '/api/order/auth/trade', method: 'get' })
export const reqSubmitOrder = (tradeNo, data) => requests({ url: `/api/order/auth/submitOrder?tradeNo=${tradeNo}`, data, method: 'post' })
export const reqGetPayInfo = (orderId) => requests({ url: `/api/payment/weixin/createNative/${orderId}`, method: 'get' })
export const reqGetPayStatus = (orderId) => requests({ url: `/api/payment/weixin/queryPayStatus/${orderId}`, method: 'get' })
export const reqGetMyOrderList = (page, limit) => requests({ url: `/api/order/auth/${page}/${limit}`, method: 'get' })
